<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="handleClick">触发test事件 并且传参</button>
    </div>
</body>
<script src="https://cn.vuejs.org/js/vue.js"></script>
<script>
    let vm = new Vue({
        mounted () {
            // 注册了一个事件
            this.$on("test",function(msg){
                console.log("测试数据一",msg);
            })
        },
        el : "#app",
        data : {

        },
        methods: {
            handleClick:function () {
                this.$emit("test","😀");
            }
        }





    });
</script>
</html>